package com.joker.order.service.impl;

import com.joker.order.domain.PmsPayWater;
import com.joker.order.mapper.PayWaterMapper;
import com.joker.order.service.PmsPayWaterService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class PmsPayWaterServiceImpl implements PmsPayWaterService {

    @Autowired
    private PayWaterMapper payWaterMapper;

    @Override
    public void insertPayWater(PmsPayWater payWater) {
        PmsPayWater pmsPayWater = payWaterMapper.selectPayWaterByOutTradeNo(payWater.getOutTradeNo());
        if (pmsPayWater != null) {
            throw new RuntimeException("已有该订单");
        }
        if (pmsPayWater == null){
            payWaterMapper.insertPayWater(payWater);
        }
    }
}
